using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace ICSharpCode.TextEditor.UserControls
{
	public class FormatCodeHtml : Form
	{
		private IContainer components = null;

		private Button btnClose;

		private Button btnCopy;

		private GroupBox gbLanguage;

		private GroupBox gbSettings;

		private FlowLayoutPanel flowLayoutPanel1;

		private FlowLayoutPanel flowLayoutPanel2;

		private RadioButton rbCSharp;

		private RadioButton rbVB;

		private RadioButton rbHtml;

		private RadioButton rbtsql;

		private RadioButton rbJS;

		private CheckBox cbLineNumbers;

		private CheckBox cbEmbedCss;

		private CheckBox cbAlternate;

		private RadioButton rbJava;
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string CodeToFormat { get; set; }

		public FormatCodeHtml(string codeToFormat, string defaultLanguage)
		{
			this.CodeToFormat = codeToFormat;
			this.InitializeComponent();
			switch (defaultLanguage)
			{
			case "C#":
				this.rbCSharp.Checked = true;
				break;
			case "VBNET":
				this.rbVB.Checked = true;
				break;
			case "XML":
				this.rbHtml.Checked = true;
				break;
			case "JavaScript":
				this.rbJS.Checked = true;
				break;
			case "Java":
				this.rbJava.Checked = true;
				break;
			case "SQL":
				this.rbtsql.Checked = true;
				break;
			case "C++.NET":
				this.rbCSharp.Checked = true;
				break;
			default:
				this.rbCSharp.Checked = true;
				break;
			}
		}

		private void btnCopy_Click(object sender, EventArgs e)
		{
		}

		private void btnClose_Click(object sender, EventArgs e)
		{
			this.btnCopy_Click(sender, e);
			base.Close();
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}

		private void InitializeComponent()
		{
			this.btnClose = new System.Windows.Forms.Button();
			this.btnCopy = new System.Windows.Forms.Button();
			this.gbLanguage = new System.Windows.Forms.GroupBox();
			this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
			this.rbCSharp = new System.Windows.Forms.RadioButton();
			this.rbVB = new System.Windows.Forms.RadioButton();
			this.rbHtml = new System.Windows.Forms.RadioButton();
			this.rbtsql = new System.Windows.Forms.RadioButton();
			this.rbJS = new System.Windows.Forms.RadioButton();
			this.rbJava = new System.Windows.Forms.RadioButton();
			this.gbSettings = new System.Windows.Forms.GroupBox();
			this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
			this.cbLineNumbers = new System.Windows.Forms.CheckBox();
			this.cbEmbedCss = new System.Windows.Forms.CheckBox();
			this.cbAlternate = new System.Windows.Forms.CheckBox();
			this.gbLanguage.SuspendLayout();
			this.flowLayoutPanel2.SuspendLayout();
			this.gbSettings.SuspendLayout();
			this.flowLayoutPanel1.SuspendLayout();
			base.SuspendLayout();
			this.btnClose.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
			this.btnClose.Location = new System.Drawing.Point(304, 196);
			this.btnClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new System.Drawing.Size(106, 30);
			this.btnClose.TabIndex = 0;
			this.btnClose.Text = "复制&&关闭";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new System.EventHandler(btnClose_Click);
			this.btnCopy.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
			this.btnCopy.Location = new System.Drawing.Point(210, 196);
			this.btnCopy.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.btnCopy.Name = "btnCopy";
			this.btnCopy.Size = new System.Drawing.Size(88, 30);
			this.btnCopy.TabIndex = 1;
			this.btnCopy.Text = "复制";
			this.btnCopy.UseVisualStyleBackColor = true;
			this.btnCopy.Click += new System.EventHandler(btnCopy_Click);
			this.gbLanguage.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
			this.gbLanguage.Controls.Add(this.flowLayoutPanel2);
			this.gbLanguage.Location = new System.Drawing.Point(14, 16);
			this.gbLanguage.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.gbLanguage.Name = "gbLanguage";
			this.gbLanguage.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.gbLanguage.Size = new System.Drawing.Size(397, 98);
			this.gbLanguage.TabIndex = 2;
			this.gbLanguage.TabStop = false;
			this.gbLanguage.Text = "语言";
			this.flowLayoutPanel2.Controls.Add(this.rbCSharp);
			this.flowLayoutPanel2.Controls.Add(this.rbVB);
			this.flowLayoutPanel2.Controls.Add(this.rbHtml);
			this.flowLayoutPanel2.Controls.Add(this.rbtsql);
			this.flowLayoutPanel2.Controls.Add(this.rbJS);
			this.flowLayoutPanel2.Controls.Add(this.rbJava);
			this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
			this.flowLayoutPanel2.Location = new System.Drawing.Point(4, 20);
			this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.flowLayoutPanel2.Name = "flowLayoutPanel2";
			this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(6, 7, 6, 7);
			this.flowLayoutPanel2.Size = new System.Drawing.Size(389, 74);
			this.flowLayoutPanel2.TabIndex = 12;
			this.rbCSharp.AutoSize = true;
			this.rbCSharp.Checked = true;
			this.rbCSharp.Location = new System.Drawing.Point(10, 11);
			this.rbCSharp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.rbCSharp.Name = "rbCSharp";
			this.rbCSharp.Size = new System.Drawing.Size(42, 21);
			this.rbCSharp.TabIndex = 5;
			this.rbCSharp.TabStop = true;
			this.rbCSharp.Text = "C#";
			this.rbCSharp.UseVisualStyleBackColor = true;
			this.rbVB.AutoSize = true;
			this.rbVB.Location = new System.Drawing.Point(60, 11);
			this.rbVB.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.rbVB.Name = "rbVB";
			this.rbVB.Size = new System.Drawing.Size(69, 21);
			this.rbVB.TabIndex = 4;
			this.rbVB.Text = "VB.NET";
			this.rbVB.UseVisualStyleBackColor = true;
			this.rbHtml.AutoSize = true;
			this.rbHtml.Location = new System.Drawing.Point(137, 11);
			this.rbHtml.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.rbHtml.Name = "rbHtml";
			this.rbHtml.Size = new System.Drawing.Size(84, 21);
			this.rbHtml.TabIndex = 6;
			this.rbHtml.Text = "Html/XML";
			this.rbHtml.UseVisualStyleBackColor = true;
			this.rbtsql.AutoSize = true;
			this.rbtsql.Location = new System.Drawing.Point(229, 11);
			this.rbtsql.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.rbtsql.Name = "rbtsql";
			this.rbtsql.Size = new System.Drawing.Size(61, 21);
			this.rbtsql.TabIndex = 3;
			this.rbtsql.Text = "T-SQL";
			this.rbtsql.UseVisualStyleBackColor = true;
			this.rbJS.AutoSize = true;
			this.rbJS.Location = new System.Drawing.Point(10, 40);
			this.rbJS.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.rbJS.Name = "rbJS";
			this.rbJS.Size = new System.Drawing.Size(84, 21);
			this.rbJS.TabIndex = 7;
			this.rbJS.Text = "JavaScript";
			this.rbJS.UseVisualStyleBackColor = true;
			this.rbJava.AutoSize = true;
			this.rbJava.Location = new System.Drawing.Point(102, 40);
			this.rbJava.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.rbJava.Name = "rbJava";
			this.rbJava.Size = new System.Drawing.Size(51, 21);
			this.rbJava.TabIndex = 8;
			this.rbJava.Text = "Java";
			this.rbJava.UseVisualStyleBackColor = true;
			this.gbSettings.Controls.Add(this.flowLayoutPanel1);
			this.gbSettings.Location = new System.Drawing.Point(14, 124);
			this.gbSettings.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.gbSettings.Name = "gbSettings";
			this.gbSettings.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.gbSettings.Size = new System.Drawing.Size(393, 67);
			this.gbSettings.TabIndex = 3;
			this.gbSettings.TabStop = false;
			this.gbSettings.Text = "设置";
			this.flowLayoutPanel1.Controls.Add(this.cbLineNumbers);
			this.flowLayoutPanel1.Controls.Add(this.cbEmbedCss);
			this.flowLayoutPanel1.Controls.Add(this.cbAlternate);
			this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 20);
			this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.flowLayoutPanel1.Name = "flowLayoutPanel1";
			this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(6, 7, 6, 7);
			this.flowLayoutPanel1.Size = new System.Drawing.Size(385, 43);
			this.flowLayoutPanel1.TabIndex = 1;
			this.cbLineNumbers.AutoSize = true;
			this.cbLineNumbers.Location = new System.Drawing.Point(10, 11);
			this.cbLineNumbers.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.cbLineNumbers.Name = "cbLineNumbers";
			this.cbLineNumbers.Size = new System.Drawing.Size(51, 21);
			this.cbLineNumbers.TabIndex = 0;
			this.cbLineNumbers.Text = "行号";
			this.cbLineNumbers.UseVisualStyleBackColor = true;
			this.cbEmbedCss.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
			this.cbEmbedCss.AutoSize = true;
			this.cbEmbedCss.Location = new System.Drawing.Point(69, 11);
			this.cbEmbedCss.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.cbEmbedCss.Name = "cbEmbedCss";
			this.cbEmbedCss.Size = new System.Drawing.Size(73, 21);
			this.cbEmbedCss.TabIndex = 1;
			this.cbEmbedCss.Text = "嵌入CSS";
			this.cbEmbedCss.UseVisualStyleBackColor = true;
			this.cbAlternate.AutoSize = true;
			this.cbAlternate.Location = new System.Drawing.Point(150, 11);
			this.cbAlternate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			this.cbAlternate.Name = "cbAlternate";
			this.cbAlternate.Size = new System.Drawing.Size(111, 21);
			this.cbAlternate.TabIndex = 2;
			this.cbAlternate.Text = "交替改变行颜色";
			this.cbAlternate.UseVisualStyleBackColor = true;
			base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 17f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(425, 242);
			base.Controls.Add(this.gbSettings);
			base.Controls.Add(this.gbLanguage);
			base.Controls.Add(this.btnCopy);
			base.Controls.Add(this.btnClose);
			base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			base.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			base.Name = "FormatCodeHtml";
			base.ShowIcon = false;
			base.ShowInTaskbar = false;
			base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
			base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Copy Code as Html";
			this.gbLanguage.ResumeLayout(false);
			this.flowLayoutPanel2.ResumeLayout(false);
			this.flowLayoutPanel2.PerformLayout();
			this.gbSettings.ResumeLayout(false);
			this.flowLayoutPanel1.ResumeLayout(false);
			this.flowLayoutPanel1.PerformLayout();
			base.ResumeLayout(false);
		}
	}
}
